<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css" />
</head>
<body>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>订单信息修改</legend>
</fieldset>
<form class="layui-form" action="${pageContext.request.contextPath}/order/update" method="post">
    <div class="layui-form-item">
        <label class="layui-form-label">ID</label>
        <div class="layui-input-inline">
            <input readonly="readonly" type="text" name="id" value="${order.id}" lay-verify="title" autocomplete="off" placeholder="请输入ID" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">公司名称</label>
        <div class="layui-input-inline">
            <input type="text" name="companyName" value="${order.companyName}" lay-verify="title" autocomplete="off" placeholder="请输入公司名称" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">订单总数</label>
        <div class="layui-input-inline">
            <input type="text" name="orderCount" value="${order.orderCount}" lay-verify="title" autocomplete="off" placeholder="请输入订单数" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">总交易金额</label>
        <div class="layui-input-inline">
            <input type="text" name="sumMoney" value="${order.sumMoney}" lay-verify="title" autocomplete="off" placeholder="请输入交易金额" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item"></div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button onclick="return toSubmit()" type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">修改</button>
            <button class="layui-btn layui-btn-primary" onclick="javascript:window.history.go(-1);return false;">返回</button>
        </div>
    </div>
</form>
</body>

<script src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
<script>
    layui.use('form', function(){
        var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功

        //……

        //如果你的 HTML 是动态生成的，自动渲染就会失效
        //因此你需要在相应的地方，执行下述方法来进行渲染
        form.render();
    });

    function toSubmit() {
        alert("修改成功！")
        return true;
    }

</script>
</html>
